package deatax;


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author pson
 */
public class Die {
    
    private int sided;
    private int c_side;

    public Die(int sided) {
        this.sided = sided;
        this.c_side = -1;
    }
    
    public void newRoll() {
        this.c_side = -1;
    }
    
    public int roll() {
        int r = RNG.rand(sided) + 1;
        while (r == this.c_side) {
            r = RNG.rand(sided) + 1;
        }
        this.c_side = r;
        return r;
    }

    public int current() {
        return c_side;
    }
    
}
